Skip to content

Add mass to MDAnalysis base units - #5439

Open
sici17 wants to merge 5 commits into
MDAnalysis:developfrom
sici17:patch-1
Open

Add mass to MDAnalysis base units#5439
sici17 wants to merge 5 commits into
MDAnalysis:developfrom
sici17:patch-1

Conversation

@sici17

@sici17 sici17 commented Jul 17, 2026

Copy link
Copy Markdown

Fixes #3944

Changes made in this Pull Request:

  • Added mass to the MDAnalysis.units base-units documentation table.
  • Added "mass": "u" to MDANALYSIS_BASE_UNITS.
  • Updated the corresponding base-units test.

I did not update package/CHANGELOG because this is a small documentation/base-units table fix.

The SI value used for u is 1.66053892103219 × 10^-27 kg, which is consistent with the CODATA 2010 constants already used in MDAnalysis.units.

Note that the User Guide currently lists a newer value for u (1.66053906660(50) × 10^-27 kg). This PR intentionally keeps the MDAnalysis.units API documentation consistent with the existing CODATA 2010 values used by the module, following the maintainer guidance in the issue.

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS? (If it is not, add it!)
  • LLM/AI disclosure was updated.

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.

@read-the-docs-community

read-the-docs-community Bot commented Jul 17, 2026

Copy link
Copy Markdown

@sici17

sici17 commented Jul 20, 2026

Copy link
Copy Markdown
Author

The failing checks appear unrelated to this PR. The GitHub Actions failures are in coordinates/test_xdr.py and concern lock file cleanup behavior, while this PR only changes MDAnalysis.units and its base-units test. The Azure Windows jobs also appear to have timed out after the 60 minute limit.

@orbeckst

Copy link
Copy Markdown
Member

Cycling PR to get CI to run again.

@orbeckst orbeckst closed this Aug 31, 2026
@orbeckst orbeckst reopened this Aug 31, 2026
@orbeckst

Copy link
Copy Markdown
Member

Can you merge the latest develope (or rebase)? There may have been updates addressing CI issues.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.87%. Comparing base (ceb2e3e) to head (a1e370c).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5439   +/-   ##
========================================
  Coverage    93.87%   93.87%           
========================================
  Files          182      182           
  Lines        22522    22522           
  Branches      3206     3206           
========================================
  Hits         21143    21143           
  Misses         917      917           
  Partials       462      462           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@orbeckst orbeckst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an entry to CHANGELOG (even though its docs, it does have an open issue associated with it and it clarifies some basic underlying assumptions). Also add yourself to AUTHORS.

Can you add a sentence after the base units table to mention CODATA2010 explicitly? See suggestion.

Comment thread package/MDAnalysis/units.py
@orbeckst orbeckst self-assigned this Aug 31, 2026
@orbeckst orbeckst added the AI-assisted Generated with AI/LLM assistance label Aug 31, 2026
@orbeckst

Copy link
Copy Markdown
Member

@sici17 please explain briefly how you used AI for this PR.

@sici17

sici17 commented Sep 1, 2026

Copy link
Copy Markdown
Author

Hi Orbecks, thanks a lot for the review. I rebased the branch onto the latest develop, added the CHANGELOG entry and my name to AUTHORS, and added the requested CODATA 2010 clarification.

About the AI usage, I can say more specificallly that I used ChatGPT/Codex to help understand the issue, locate the relevant definitions inside the code and the project, start and locate the tests and inspect the logs. I personally reviewed and applied all the changes. I made sure to understand everything I was doing before actually doing it.

I’ll verify the rendered documentation once the new Read the Docs build completes.

@orbeckst orbeckst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just a minor CHANGELOG rearrangement is needed.

Comment thread package/CHANGELOG
Comment on lines +79 to +81
* Mass (u) has been added to MDAnalysis base units and
clarified that physical constants use CODATA 2010 values
(Issue #3944, PR #5439)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We add new entries at the top. Please move to directly under Fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assisted Generated with AI/LLM assistance Component-Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mass unit not listed in 'Base units' table

2 participants